import {ajax,base} from './config'


export const location = params => { return ajax.getMinData({url:`${base}/api/tbNewTaskController/location.do`, params:params,msg:"hiden"}) };

export const requestLogin = params => { return ajax.postData({url:`${base}/loginController.do?checkuser`, params:params,msg:"hiden"}) };
// 标记办公通知已读
export const personSign = params => { return ajax.getMinData({url:`${base}/api/announcementPerson/sign.do`, params:params,msg:"hiden"}) };
// 标记预约已读
export const appointmentRead = params => { return ajax.getMinData({url:`${base}/api/appointment/doRead.do`, params:params,msg:"hiden"}) };
//获取绩效信息
export const getPerformanceInfoById = params => { return ajax.getMinData({url:`${base}/performanceController.do?getTaskPerformData`, params:params}) };
//获取任务列表
//export const getTaskList = params => { return ajax.postData({url:`${base}/tbTaskController/getList.do?startDate=2016-01-01%2000:00:00&endDate=2018-01-01%2000:00:00`, params:params,msg:"hiden"}) };
export const getTaskList = params => { return ajax.getMinData({url:`${base}/api/tbNewTaskController/tasks.do`, params:params,msg:"hiden"}) };
//提交绩效数据
export const calculateTaskPerform = params => { return ajax.postData({url:`${base}/performanceController.do?calculateTaskPerform`, params:params}) };
//获取任务详情
export const taskDetail = params => { return ajax.getMinData({url:`${base}/api/tbNewTaskController/taskDetail.do`, params:params,msg:"hiden"}) };
//获取标签
export const getTags = params => { return ajax.postData({url:`${base}/api/tsTeamTagController/tags.do`, params:params,msg:"hiden"}) };
//获取人员列表
export const getPersons  = params => { return ajax.getMinData({url:`${base}/api/tbNewTaskController/persons.do`, params:params}) };
//获取车辆列表
export const getCars = (nowApp=='biandian')?params => { return ajax.getMinData({url:`${base}/api/bsCarController/cars.do`, params:params}) }:params => { return ajax.getMinData({url:`${base}/api/tbCarController/cars.do`, params:params}) };
//派工
export const taskDispatching  = params => { return ajax.postData({url:`${base}/api/tbNewTaskController/taskDispatching.do`, params:params}) };
//签到
export const getSign  = params => { return ajax.postData({url:`${base}/api/tbNewTaskController/sign.do`, params:params,msg:"签到成功"}) };
//工作执行
export const goTBConfirm  = params => { return ajax.postData({url:`${base}/api/tbNewTaskController/goTBConfirm.do`, params:params}) };
//评价
export const goTBCheck  = params => { return ajax.postData({url:`${base}/api/tbNewTaskController/goTBCheck.do`, params:params}) };
//查看绩效评价
export const getTaskPerformance  = params => { return ajax.getMinData({url:`${base}/performanceController/getTaskPerformance.do`, params:params,msg:"hiden"}) };
//获取规范名称
export const getPointVersions  = params => { return ajax.getMinData({url:`${base}/api/tbNewTaskController/pointVersionsApp.do`, params:params,msg:"hiden"}) };
//更新规范树
export const setPointVersions  = params => { return ajax.postData({url:`${base}/api/tbNewTaskController/updateTask.do`, params:params}) };
//生产类别树
export const typeTree  = params => { return ajax.getMinData({url:`${base}/api/tbTacheTypeController/typeTree.do?isPhone=1`, params:params}) };
//变电站下拉菜单数据
export const getSubstationList  = params => { return ajax.getMinData({url:`${base}/bsSubstationController/getList.do`, params:params}) };
//获取部门树
export const getDeparts  = params => { return ajax.getMinData({url:`${base}/api/tbNewTaskController/getDeparts4app.do`, params:params}) };
//微信调签名
export const weiXin = params => { return ajax.getMinData({url:`${base}/api/wxController/getSignature.do`, params:params}) };
//获取用户信息
export const getAuthMenu = params => { return ajax.getMinData({url:`${base}/api/authController/getAuthMenu.do`, params:params}) };
//获取数据字典，返回数据:专业(speciality),工作方式(working),电压等级(voltageLevel),风险等级(riskLevel)
export const pageData = params => { return ajax.getMinData({url:`${base}/api/tbNewTaskController/pageData.do`, params:params}) };
//获取计划开始时间
export const getDefaultValue = params => { return ajax.getMinData({url:`${base}/api/tbNewTaskController/getDefaultValue.do`, params:params}) };

export const getAuthMenuOperation = params => { return ajax.getMinData({url:`${base}/api/authController/getAuthMenuOperation.do`, params:params}) };
//提交任务工单
export const addTask = params => { return ajax.postData({url:`${base}/api/tbNewTaskController/addTask.do `, params:params}) };
//扫码获取详情/api/tool/getToolDetailAndLog.do
export const getToolDetailAndLog  = params => { return ajax.getMinData({url:`${base}/api/qrfun/getToolDetailAndLog.do`, params:params}) };
//提交操作表单
export const useTools  = params => { return ajax.getMinData({url:`${base}/api/tool/useTools.do`, params:params}) };
//获取操作日志列表
export const getToolsLogList  = params => { return ajax.getMinData({url:`${base}/api/tool/getToolsLogList.do`, params:params}) };
//获取操作日志详情
export const getToolsLogDetail  = params => { return ajax.getMinData({url:`${base}/api/tool/getToolsLogDetail.do`, params:params}) };
//获取台帐列表
export const getToolsList  = params => { return ajax.getMinData({url:`${base}/api/tool/getToolsList.do`, params:params}) };
//获取材料类别
export const findToolTypeList  = params => { return ajax.getMinData({url:`${base}/api/tool/findToolTypeList.do`, params:params}) };
//转至暂结
export const goMiddle  = params => { return ajax.postData({url:`${base}/api/tbNewTaskController/goMiddle.do`, params:params}) };
//转出暂结
export const backMidlExecing  = params => { return ajax.postData({url:`${base}/api/tbNewTaskController/backMidlExecing.do`, params:params}) };
//任务(已派工)->待派工
export const backDispatch  = params => { return ajax.postData({url:`${base}/api/tbNewTaskController/backDispatch.do`, params:params}) };
//任务(待确认)->执行
export const backExecing  = params => { return ajax.postData({url:`${base}/api/tbNewTaskController/backExecing.do`, params:params}) };
//转至暂结(未确认)
export const backConfirmMidl  = params => { return ajax.postData({url:`${base}/api/tbNewTaskController/backConfirmMidl.do`, params:params}) };

// 管理班站
export const getOtherDepart  = params => { return ajax.postData({url:`${base}/api/tool/getOtherDepart.do`, params:params}) };
//添加标签
export const addTag  = params => { return ajax.postData({url:`${base}/api/tsTeamTagController/add.do`, params:params}) };
// 获取使用地点列表
export const getToolPlaceList  = params => { return ajax.postData({url:`${base}/api/tool/getToolPlaceList.do`, params:params}) };
// 删除使用地点
export const removeToolPlace  = params => { return ajax.postData({url:`${base}/api/tool/removeToolPlace.do`, params:params}) };
// 新增使用地点
export const addToolPlace  = params => { return ajax.postData({url:`${base}/api/tool/addToolPlace.do`, params:params}) };
// 编辑使用地点
export const updateToolPlace  = params => { return ajax.postData({url:`${base}/api/tool/updateToolPlace.do`, params:params}) };

//查看上传图片
//export const downloadToolsWX  = params => { return ajax.getMinData({url:`${base}/api/tool/getToolsLogDetail.do`, params:params}) };
// base64图片上传
export const uploadImage = params => { return ajax.postData({url:`${base}/file/tool/uploadImage.do`, params:params}) };



//知识库
export const getKnowledgeBaseList = params => { return ajax.getBigData({url:`${base}/api/knowledgeBase/getKnowledgeBaseList.do`, params:params}) };


/* 隐患*/
//获取隐患列表数据
export const getHiddenData  = params => { return ajax.postData({url:`${base}/hiddenDangerController/getHiddenDataApp.do`, params:params}) };
// 获取隐患的基本信息
export const getHiddenBaseInfo  = params => { return ajax.postData({url:`${base}/hiddenDangerController/getHiddenBaseInfoApp.do
`, params:params}) };
// 获取部门
export const getDepartZtree  = params => { return ajax.postData({url:`${base}/api/kitCommonControler/getDepartZtree.do
`, params:params}) };
// 获取部门
export const getDepartsTree  = params => { return ajax.getMinData({url:`${base}/api/tbNewTaskController/getDepartsTree.do
`, params:params}) };
// 获取线路列表
export const getLineList  = params => { return ajax.postData({url:`${base}/api/kitCommonControler/getLineList.do
`, params:params}) };
export const getLineList2  = params => { return ajax.getMinData({url:`${base}/hiddenDangerController.do?getHiddenLine
`, params:params}) };
// 获取隐患详情
export const getHiddenDetailData  = params => { return ajax.postData({url:`${base}/hiddenDangerController/getHiddenDetailDataApp.do
`, params:params}) };
// 获取跟踪记录
export const getHiddenTraceData  = params => { return ajax.postData({url:`${base}/api/HidenApiController/getHiddenTraceData.do
`, params:params}) };
// 获取全部部门
export const getAllDepart  = params => { return ajax.postData({url:`${base}/api/HidenApiController/getAllDepartApp.do
`, params:params}) };
// 获取部门人员列表
export const getUserOfTimeAndType  = params => { return ajax.postData({url:`${base}/hiddenDangerController/getUserOfTimeAndTypeApp.do
`, params:params}) };
// 获取待办隐患列表
export const taskAllList  = params => { return ajax.postData({url:`${base}/api/hiddenDangerController.do?taskAllList`, params:params}) };
// 获取历史隐患列表
export const taskHistoryList  = params => { return ajax.postData({url:`${base}/hiddenDangerController.do?taskHistoryList`, params:params}) };
// 获取解决类型和描述
export const getDealTypeAndDesc  = params => { return ajax.postData({url:`${base}/HidenApiController/getDealTypeAndDescApp.do`, params:params}) };
// 提交新增跟踪记录数据
export const saveHiddenTrace  = params => { return ajax.postData({url:`${base}/hiddenDangerController.do?saveHiddenTrace`, params:params}) };
// 新增隐患
export const saveHiddenLib  = params => { return ajax.postData({url:`${base}/hiddenDangerController/saveHiddenLibApp.do`, params:params}) };
// 隐患详情图片资料
export const getDisplayPhoto  = params => { return ajax.postData({url:`${base}/hiddenDangerController/getDisplayPhotoApp.do`, params:params}) };


/*我*/
//任务列表：page、rows、state1、state2、createUserId（创建人id）、myUserId（参与人id）
export const tasksForMe = params => { return ajax.getMinData({url:`${base}/api/tbNewTaskController/tasksForMe.do`, params:params}) };
//任务数量：state1、state2、myUserId
export const tasksCount = params => { return ajax.getMinData({url:`${base}/api/tbNewTaskController/tasksCount.do`, params:params}) };


/*首页*/
// 获取首页常用的工具
// export const getUserMenu  = params => { return ajax.postData({url:`${base}/api/appHomeControler/getUserMenu.do`, params:params}) };
export const getUserMenu  = params => { return ajax.getMinData({url:`${base}/api/appHomeControler/getUserMenu.do`, params:params}) };
// 获取任务信息统计
export const getTaskStatistics  = params => { return ajax.getMinData({url:`${base}/tbTaskController/getTaskStatistics.do`, params:params}) };
// 获取办公通知
export const getWorkStatistics  = params => { return ajax.getMinData({url:`${base}/api/appHomeControler/getWorkStatistics.do`, params:params}) };
/*// 获取学习列表未读通知
export const getNoSignLearningList  = params => { return ajax.getMinData({url:`${base}/api/learning/getNoSignLearningList.do`, params:params}) };
// 获取办公列表未读通知
export const getNoSignAnnouncementList  = params => { return ajax.getMinData({url:`${base}/api/announcement/getNoSignAnnouncementList.do`, params:params}) };*/
// 获取部门
export const MPgetAllDepart = params => { return ajax.getMinData({url:`${base}/api/appHomeControler/getAllDepart.do`, params:params}) };
// 获取问题库统计
export const getEquipCountStatistics = params => { return ajax.getMinData({url:`${base}/equipmentProblemController/getEquipCountStatistics.do`, params:params}) };
// 删除自定义图标
export const deleteUserMenu = params => { return ajax.getMinData({url:`${base}/api/appHomeControler/deleteUserMenu.do`, params:params}) };
// 添加自定义图标
export const addUserMenu = params => { return ajax.getMinData({url:`${base}/api/appHomeControler/addUserMenu.do`, params:params}) };
// 输电隐患统计
export const getHiddenStatistics = params => { return ajax.getMinData({url:`${base}/hiddenDangerController.do?getHiddenStatistics`, params:params}) };
// 输电任务统计
export const SDgetTaskStatistics = params => { return ajax.getMinData({url:`${base}/api/tbNewTaskController/getTaskStatistics.do
`, params:params}) };

// 获取部门
// export const getWXOtherDepart = params => { return ajax.getMinData({url:`${base}/api/map/getWXOtherDepart.do`, params:params}) };
// export const getWXOtherDepart = params => { return ajax.getMinData({url:`${base}/api/qrfun/getOtherDepart.do`, params:params}) };
export const getWXOtherDepart = params => { return ajax.getMinData({url:`${base}/api/authController/getDepartZtree.do`, params:params}) };

/*学习活动*/
// 获取部门
export const oneGetOtherDepart = params => { return ajax.getMinData({url:`${base}/api/map/getWXOtherDepart.do`, params:params}) };
// 获取学习活动列表
export const datagrid = params => { return ajax.getMinData({url:`${base}/learningController/datagrid.do`, params:params}) };
// 查看学习详情
export const getLearningById = params => { return ajax.getMinData({url:`${base}/learningController/getLearningById.do`, params:params}) };
// 参与学习
export const sign = params => { return ajax.postData({url:`${base}/api/learningPerson/sign.do`, params:params}) };

/*办公通知*/
// 获取办公通知列表
export const Wdatagrid = params => { return ajax.getMinData({url:`${base}/announcementController/datagrid.do`, params:params}) };
// 查看通知详情
export const getAnnouncementById = params => { return ajax.getMinData({url:`${base}/announcementController/getAnnouncementById.do`, params:params}) };
// 
export const announceSign = params => { return ajax.postData({url:`${base}/api/announcementPerson/sign.do`, params:params}) };
/*发布学习*/
// 获取人员名单
export const getAnnouncementList = params => { return ajax.getMinData({url:`${base}/api/groupUserApi/getAnnouncementList.do`, params:params}) };
// 提交发布内容  api/learning/addLearning.do
export const addLearning = params => { return ajax.postData({url:`${base}/learningController/doAdd.do`, params:params}) };

/*发布通知*/
// 提交发布内容
export const addAnnouncement = params => { return ajax.postData({url:`${base}/api/announcement/addAnnouncement.do`, params:params}) };

/*查询状态*/
// 状态列表
export const getAppointmentByPage = params => { return ajax.getMinData({url:`${base}/api/appointment/getAppointmentByPage.do`, params:params}) };
// 查看详情
export const getAppointmentById = params => { return ajax.getMinData({url:`${base}/api/appointment/getAppointmentById.do`, params:params}) };
// 取消预约
export const cancelAppointment = params => { return ajax.postData({url:`${base}/api/appointment/cancelAppointment.do `, params:params}) };
// 保存预约进站
export const doSaveAppointment = params => { return ajax.postData({url:`${base}/api/appointment/doSaveAppointment.do`, params:params}) };

// 预约管理
//处理预约
export const dealAppointment = params => { return ajax.postData({url:`${base}/appointmentController/doUpdate.do`, params}); };
//预约详情获取附件
export const getPhotosByAppointmentId = params => { return ajax.getMinData({url:`${base}/api/appointment/getAppointmentById.do 
 `, params}); };
//检查app版本
export const checkAppUpdate = params => { return ajax.getMinData({url:`${base}/file/downloadController/checkAppUpdate.do`, params:params}) };


